package com.spddr.pmos.jpa;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@Entity
@Table(name = "city_company")
@DiscriminatorValue(value = "17")
public class CityCompany extends Organization {
	private static final long serialVersionUID = 1L;

	private CityCompany parent;

	public CityCompany() {
		super();
	}

	public CityCompany(Long id) {
		super(id);
	}

	public CityCompany(Long id, String name) {
		super(id, name);
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parent")
	@JsonSerialize(using = cn.seqdata.jackson.ObjectSerializer.IdName.class)
	public CityCompany getParent() {
		return this.parent;
	}

	public void setParent(CityCompany parent) {
		this.parent = parent;
	}
}